package com.henry.javastudy.c04;

import java.util.concurrent.CountDownLatch;

public class MyRunnable2 implements Runnable {
    private int result=0;
    private Object lockObj;
    public MyRunnable2(Object lockObj)
    {
        this.lockObj=lockObj;

    }    @Override
    public void run() {
        synchronized (lockObj) {
            setResult(MyCanculate.sum());
            lockObj.notifyAll();
        }
    }
    public void setResult(Integer i){
        result=i;
    }
    public int getResult()
    {
        return result;
    }
}
